<template>
  <div id="app">
    <topbar v-if="$route.meta.isTopbar"></topbar>
    <div class="container">
      <router-view></router-view>
    </div>
    <van-tabbar class="test" v-model="active" v-if="$route.meta.isShow">
      <van-tabbar-item icon="home-o" to="/home">主页</van-tabbar-item>
      <van-tabbar-item icon="apps-o" to="/category">分类</van-tabbar-item>
      <van-tabbar-item icon="cart-o" to="/cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="https://b.yzcdn.cn/vant/icon-demo-1126.png" to="/my">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>


<script>
import axios from "axios"
import topbar from "@/components/publicComponents/topbar.vue"

import { test } from "@/api/sjAPI"
export default {
  name: "AppApp",
  components:{
    topbar
  },
  data() {
    return {
      active: 0,
    };
  },

  mounted() {
    // test().then(res => {
    //   console.log("res",res);
    // })
      this.$bus.$on("gomy", () => {
        this.active = 3
      })
  },

  methods: {
  },
};
</script>

<style lang="less">
// @import url("./assets/css/reset.css");
html,
body {
  height: 100%;
  overflow: hidden;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

ul {
  padding: 0;
  list-style: none;
}

.container {
  height: calc(100vh - 236px)
}
.app::-webkit-scrollbar { display: none; }
</style>
